/*jslint sloppy: true */
/*global require */
var angular = require('angular'),
	probe = require('../global');
require('./open.html');
probe.controller('OpenTask', function (ocDI, ocData, Task, $scope) {

	$scope.watchTask = function (task) {
		$scope.task = task;
	};
	$scope.open = function () {
		(ocData.fn || angular.noop)($scope.task);
		ocDI.closeDialog();
	};
	$scope.taskList = Task.list();

	//init
	(ocData.preOpenTask || angular.noop)($scope);
	$scope.isDraft = true;
});
